/*
 * @FileName: [CompanyController.java] 
 * @Package com.bci.pwtz.controller 
 * 
 * 
 * Copyright (c) 2011-2015 BCINFO Technology Limited Com.
 * All rights reserved.
 * 
 * This software is the confidential and proprietary 
 * information of BCINFO Technology Limited Company
 * ("Confidential Information"). You shall not disclose 
 * such Confidential Information and shall use it only
 * in accordance with the terms of the contract agreement 
 * you entered into with RKY.
 * 
 * $Rev: 896 $
 * $LastChangedDate$
 * $LastChangedBy: huangb $
 * 
 * @category ALUMNI
 * @version 1.1
 * @author $Author: huangb $
 *
 * Change History:[Formatter: author date description] <br/>
 * 1
 * 2
 * 3
*/


package com.bci.pwtz.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bci.pwtz.exception.PwtzDatabaseException;
import com.bci.pwtz.mysql.model.GeoCode;
import com.bci.pwtz.service.GeoCodeService;

/**
 * 一句话描述 <br/>
 * <p>Description:<br/>
 *    <p>TODO 详细描述
 *
 * <p>For Examples <br/>
 * <PRE>
 *      TODO 代码使用示例
 * </PRE>
 * <p>
 */
@Controller
@RequestMapping("/user/geo")
public class GeoCodeController extends AbstractController
{
    @Autowired
    private GeoCodeService geoCodeService;
    
    @RequestMapping(value="/list",method=RequestMethod.POST)
    @ResponseBody
    public List<GeoCode>  getGeoByParent(Long parent){
        System.out.println("parent="+parent);
        List<GeoCode> list = new ArrayList<GeoCode>();
        try
        {
            list=geoCodeService.findGeoCodeList(parent);
        }
        catch (PwtzDatabaseException e)
        {
            e.printStackTrace();
        }
        return list;
    }
}
